﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DAL;

namespace 包覆门
{
    public partial class TestForm : Form
    {
        public TestForm()
        {
            InitializeComponent();
            
        }

        private DataTable dtMxbh = new DataTable();//门型编号
        private DataTable dtZs = new DataTable();//柱身
        private DataTable dtZt = new DataTable();//柱头
        private DataTable dtDx = new DataTable();//顶线
        private DataTable dtDeng = new DataTable();//灯线
        private DataTable dtTJB = new DataTable();//踢脚板
        private DictionaryDAL dry = new DictionaryDAL();//数据处理
        private OrderList orderlist = new OrderList();

        private void TestForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            //mainform.tf = null;
        }
        //新增一行
        private void tsbAdd_Click(object sender, EventArgs e)
        {
            dgorder.Rows.Add();
        }
        //按钮开关
        private void EnableButton() { 
            
        }
        //按钮开关
        private void DisableButton() { 
            
        }
        //加载数据信息
        private void TestForm_Load(object sender, EventArgs e)
        {
            dtMxbh = dry.GetByMXBH("0");
            // DataGridViewComboBoxColumn dgvcb = dgOrderDetail.Columns["mxbh"] as DataGridViewComboBoxColumn;

            mxbh.DataSource = dtMxbh;
            mxbh.DisplayMember = "mxsm";
            mxbh.ValueMember = "mxbh";
            mxbh.DataPropertyName = "mxbh";

        }
        //详情表新增一行
        private void btnAddLine_Click(object sender, EventArgs e)
        {
            ((DataTable)dgOrderDetail.DataSource).Rows.Add();
            //DataGridViewComboBoxColumn dgvcb = dgOrderDetail.Columns["mxbh"] as DataGridViewComboBoxColumn;
            
            //    dgvcb.DataPropertyName = "mxbh";
            //    dgvcb.DisplayMember = "mxsm";
            //    dgvcb.ValueMember = "mxbh";
            //    dgvcb.DataSource = dtMxbh;
           
            
        }
        //详情删除选中行
        private void btnDelLine_Click(object sender, EventArgs e)
        {

        }
        //搜索
        private void tsbSearch_Click(object sender, EventArgs e)
        {
            dgOrderDetail.DataSource = orderlist.GetOrderDetail();
        }

        private void tsbDel_Click(object sender, EventArgs e)
        {
           
        }

       
    }
}
